package com.yanjiali.service;

import com.yanjiali.entity.History;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yanjiali.model.R;
import com.yanjiali.model.req.RecordPersonalHistoricalRecordsReq;
import com.yanjiali.model.resp.ObtainTheHistoricalRecordsTo5ThroughTheUserIdResp;
import com.yanjiali.model.resp.RecordPersonalHistoricalRecordsResq;
import com.yanjiali.model.resp.SearchHistoryByTitleResp;
import com.yanjiali.vo.HistoricalRecordYearVO;

import java.util.List;

/**
 * @Package: com.yanjiali.service
 * @Author: yanjiali
 * @Created: 2025/4/19 15:06
*/
public interface HistoryService extends IService<History>{

    /**
     * 记录个人历史记录
     * @param recordPersonalHistoricalRecordsReq
     * @return
     */
    R<RecordPersonalHistoricalRecordsResq> recordPersonalHistoricalRecords(RecordPersonalHistoricalRecordsReq recordPersonalHistoricalRecordsReq);

    /**
     * 获取用户最近前五个历史记录
     * @return
     */
    R<ObtainTheHistoricalRecordsTo5ThroughTheUserIdResp> obtainTheHistoricalRecordsTo5ThroughTheUserId();

    /**
     * 获取当前登录用户当前年份的所有历史记录
     * @return
     */
    R<HistoricalRecordYearVO> obtainTheCurrentYearsHistoricalRecords();

    /**
     * 通过历史记录标题搜索对应的历史记录
     * @param title
     * @return
     */
    R<SearchHistoryByTitleResp> searchHistoryByTitle(String title);

    /**
     * 通过id集合批量删除对应的用户历史记录数据
     * @param ids
     * @return
     */
    R deleteInBatches(List<Long> ids);

    /**
     * 通过id删除一条用户历史记录
     * @param id
     * @return
     */
    R deleteOneByOne(Long id);

    /**
     * 删除用户所有历史记录
     * @return
     */
    R deleteAll();
}
